<?php
/**
 * 促销页面
 *
 */
defined('InShopNC') or exit('Access Invalid!');
class special_offerControl extends MobileControl{
    public function __construct() {
		parent::__construct ();
	}
	
	/**
	 * 特价商品
	 */
	public function indexOp() {
		/*
		*是否赠送积分
		
		if(!memberModel::is_give_points()){
			showMessage('您暂时不符合查看特价商品的条件，赶快下单采购吧~（你在精品超市单笔消费满300元即可查看特价商品专区）','','html','error',1,4000);
		}*/
		$pagesize=25;
        $curpage=$_GET['curpage'];
		//精品超市 上架 设置特价商品
		$goods_sort_orderby = " ORDER BY goods.goods_sort asc";
		$sql = "SELECT goods.goods_sort,
        goods.goods_id,
        goods.store_id,
        goods.goods_name,
        goods.goods_store_price,
        goods.goods_image 
        FROM #__goods as `goods`
		WHERE goods.store_id = '" . OFFICIAL_STORE_ID . "' and goods.goods_state='0' and goods.goods_show= '1' and goods.special_offer= '1'";
		$sql .=$goods_sort_orderby;
		
		$rs = db::PageQuery($sql,$curpage,$pagesize);
		$page	= new Page();
        $page->setEachNum($pagesize);
        $page->setNowPage($curpage);
        $page->setTotalNum($rs->pageRows());
        $page->setStyle('admin');				
		$result_array=$rs->fetchAll();
		
		Tpl::output('show_page',$page->show());
		Tpl::output('list',$result_array);
		Tpl::showpage('special_offer');
	}
}